/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyivtbtrasmob")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyivtbtrasmob.findAll", query = "SELECT p FROM Pyivtbtrasmob p"),
    @NamedQuery(name = "Pyivtbtrasmob.findByPyivtbtrasmobid", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.pyivtbtrasmobid = :pyivtbtrasmobid"),
    @NamedQuery(name = "Pyivtbtrasmob.findByReferencia", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.referencia = :referencia"),
    @NamedQuery(name = "Pyivtbtrasmob.findByFecha", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.fecha = :fecha"),
    @NamedQuery(name = "Pyivtbtrasmob.findByFecharegistro", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyivtbtrasmob.findByEntregaid", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.entregaid = :entregaid"),
    @NamedQuery(name = "Pyivtbtrasmob.findByRecibeid", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.recibeid = :recibeid"),
    @NamedQuery(name = "Pyivtbtrasmob.findByObservaciones", query = "SELECT p FROM Pyivtbtrasmob p WHERE p.observaciones = :observaciones")})
public class Pyivtbtrasmob implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyivtbtrasmobid")
    private Integer pyivtbtrasmobid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "referencia")
    private String referencia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecha;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Column(name = "entregaid")
    private int entregaid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "recibeid")
    private int recibeid;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne(optional = false)
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyivtbtipotrasid", referencedColumnName = "pyivtbtipotrasid")
    @ManyToOne(optional = false)
    private Pyivtbtipotras pyivtbtipotrasid;
    @JoinColumn(name = "pyivtbmobid", referencedColumnName = "pyivtbmobid")
    @ManyToOne(optional = false)
    private Pyivtbmob pyivtbmobid;

    public Pyivtbtrasmob() {
    }

    public Pyivtbtrasmob(Integer pyivtbtrasmobid) {
        this.pyivtbtrasmobid = pyivtbtrasmobid;
    }

    public Pyivtbtrasmob(Integer pyivtbtrasmobid, String referencia, Date fecha, Date fecharegistro, int entregaid, int recibeid) {
        this.pyivtbtrasmobid = pyivtbtrasmobid;
        this.referencia = referencia;
        this.fecha = fecha;
        this.fecharegistro = fecharegistro;
        this.entregaid = entregaid;
        this.recibeid = recibeid;
    }

    public Integer getPyivtbtrasmobid() {
        return pyivtbtrasmobid;
    }

    public void setPyivtbtrasmobid(Integer pyivtbtrasmobid) {
        this.pyivtbtrasmobid = pyivtbtrasmobid;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public Date getFecha() {
        return fecha;
    }

    public void setFecha(Date fecha) {
        this.fecha = fecha;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public int getEntregaid() {
        return entregaid;
    }

    public void setEntregaid(int entregaid) {
        this.entregaid = entregaid;
    }

    public int getRecibeid() {
        return recibeid;
    }

    public void setRecibeid(int recibeid) {
        this.recibeid = recibeid;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyivtbtipotras getPyivtbtipotrasid() {
        return pyivtbtipotrasid;
    }

    public void setPyivtbtipotrasid(Pyivtbtipotras pyivtbtipotrasid) {
        this.pyivtbtipotrasid = pyivtbtipotrasid;
    }

    public Pyivtbmob getPyivtbmobid() {
        return pyivtbmobid;
    }

    public void setPyivtbmobid(Pyivtbmob pyivtbmobid) {
        this.pyivtbmobid = pyivtbmobid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyivtbtrasmobid != null ? pyivtbtrasmobid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyivtbtrasmob)) {
            return false;
        }
        Pyivtbtrasmob other = (Pyivtbtrasmob) object;
        if ((this.pyivtbtrasmobid == null && other.pyivtbtrasmobid != null) || (this.pyivtbtrasmobid != null && !this.pyivtbtrasmobid.equals(other.pyivtbtrasmobid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyivtbtrasmob[ pyivtbtrasmobid=" + pyivtbtrasmobid + " ]";
    }
    
}
